import { post, get, fileDownload } from '@/utils/request/index';
import ApiUrl from '@/api/url';

// 获取查询条件（对账工作台/手工对账查询规则页面--查询条件）
export async function getAllSearchNames() {
  const rtn = (await get(ApiUrl.getAllSearchNames, null)) as any;
  return rtn.data;
}

export async function getSearchNames() {
  const rtn = (await get(ApiUrl.getSearchNames, null)) as any;
  return rtn.data;
}

// 根据名称获取查询条件（对账工作台--查询接口）
export async function getSearchConditionByName(param: any = { searchName: '' }) {
  const rtn = (await get(ApiUrl.getSearchConditionByName, param)) as any;
  return rtn.data;
}

// 新增查询规则（对账工作台--新增接口）
export async function saveSearchCondition(param) {
  const rtn = (await post(ApiUrl.saveSearchCondition, param)) as any;
  return rtn.data;
}

// 查询规则（手工对账查询规则页面--查询接口）
export async function getSearchCondition(param) {
  const rtn = (await post(ApiUrl.getSearchCondition, param)) as any;
  return rtn.data;
}

// 删除规则（手工对账查询规则页面--删除接口）
export async function removeSearchCondition(param) {
  const rtn = (await get(ApiUrl.removeSearchCondition, param)) as any;
  return rtn.data;
}

// 导出规则（手工对账查询规则页面--导出接口）
export async function exportSearchCondition(param) {
  const rtn = (await fileDownload(ApiUrl.exportSearchCondition, param)) as any;
  return rtn.data;
}
